<template>
    <div>
        <div class="layout-main" >
            <div style="display:flex;item-align:center;padding-top:10px;padding-bottom:10px;margin-top:50px;margin-bottom:30px;">  
                <el-breadcrumb separator-class="el-icon-arrow-right">
                    <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                    <el-breadcrumb-item :to="{ path: '/supplyDemand' }">供需展示</el-breadcrumb-item>
                    <el-breadcrumb-item>商品详情</el-breadcrumb-item>
                </el-breadcrumb>
            </div>
            <div class="d-wrapper">
                <!-- <img :src="imgsrc" style="position:absolute;top:75px;left:75px;width:150px;height:150px" alt="商品图像"/> -->

                
                <div style="position:absolute;top:45px;left:400px">
                    <el-card shadow="never" class="text-area">
                        <div style="font-size:20px;font-weight:bold;">{{ this.item.goodsSkuName }}</div>
                        <div>商品种类:{{ this.item.goodsTypeId }}</div>
                        <div>提供商联系电话:{{ this.item.firm_phone }}</div>
                        <div>提供商邮箱:{{ this.item.firm_email }}</div>
                    </el-card>
                </div>
                <div>
                    <img :src="imgsrc" style="position:absolute;top:75px;left:150px;width:150px;height:150px" alt="商品图像"/>
                </div>
                </div>

            <div>
                <el-card class="box-card">
                    <div slot="header" class="clearfix">
                        <div style="font-weight:bold">商品详情</div>
                    </div>
                    <div class="text item">
                        <div>
                            <li v-for="(value,key,index) in item.goodsSkuSpec" :key="index" style="list-style:none">
                                {{key}}:{{value}}
                            </li>
                        </div>
                        <div>
                            {{ this.item.goodsSkuDesc }}
                        </div>
                    </div>
                </el-card>
                <div></div>
            </div>

        </div>
    </div>
</template>

<script>
import axios from "@/utils/request";
export default ({
    data() {
        return{
            queryInfo:{},
            item:{'goodsSkuId':'1','goodsSkuName':'贵阳铝土矿','goodsSkuSpec':{"长":"30cm","宽":"20cm"},'goodsSkuPrice':0.03,'goodsTypeId':'铝矿','firm_name':'某公司','firm_phone':'182011204411','firm_email':'example@eecc.com','goodsSkuDesc':'修文小山坝铝土矿矿区1957年开始勘探，累计探明铝土矿2026.4万吨，矿石平均品位为67.91%。1979年五龙寺矿区开始投产，矿层呈似层状，产状平缓，倾角5°～10°，向北东倾斜。'},
            imgsrc:require('@/assets/ltk1.jpg'),
            fit:"fill",
            url:"http://localhost:8009/lv-industry-app/goodsSku/" 
            
        };
    },
    created(){
        console.log(this.$route.params.id)
        this.queryInfo["goodsSkuId"]=this.$route.params.id

        this.getItem()

    },
    methods:{

        async getItem(){
            // const {data:res} = await axois.get(this.url,this.queryInfo)
            // this.item = res.item;
            await axios.get(this.url+this.queryInfo.goodsSkuId).then((result)=>
            {
                result.data.goodsSkuSpec = JSON.parse(result.data.goodsSkuSpec)
                console.log(result.data.goodsSkuSpec)
                if(result.success == true)
                {
                    this.item = result.data
                }
            }
            )
        },
    },
})
</script>

<style scoped>

.layout-main
{
    margin-left: 120px;
    margin-right: 120px
}

/* 分两边的 */
.d-wrapper
{
    background-color:#ffffff;
    border-style:none;
    box-shadow: grey 0px 0px 10px 1px;
    display:flex;
    position:relative;
    justify-content: center;
    align-items:center;
    height:400px;
    width:80%;
    margin-top:30px;
    margin-bottom:30px;
}

  .text {
    font-size: 14px;
    text-align: left;
  }



.text-area
{
    border-style:none;
    font-size: 14px;
    text-align: left;
    line-height: 60px;
}

  .item {
    margin-bottom: 18px;
  }

  .clearfix
  {
    text-align:left;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }
  .clearfix:after {
    clear: both
  }

  .box-card {
    width: 80%;
    margin-bottom:30px;
    box-shadow: gray 0px 0px 10px 2px;
  }

#TA
{
   
   
   height:200px;
   width:80%;
   padding:20px 20px 10px 10px;
   margin-top:80px;
   margin-bottom:30px;
   padding-top:30px;
   padding-bottom:30px;
   box-sizing: border-box;
   position:relative;

}
</style>